<!-- Card.vue -->
<script setup>
defineProps({
  title: {
    type: String,
    default: '卡片标题',
  },
})
</script>
<template>
  <div class="card">
    <div class="card-header">
      <slot name="header">
        <h3>{{ title }}</h3>
      </slot>
    </div>
    <div class="card-body">
      <slot>
        <p>卡片内容区域</p>
      </slot>
    </div>
    <div class="card-footer">
      <slot name="footer">
        <button>确定</button>
      </slot>
    </div>
  </div>
</template>
<style scoped>
.card {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.card-header {
  background-color: #f8f9fa;
  padding: 10px 15px;
  border-bottom: 1px solid #ddd;
}
.card-body {
  padding: 15px;
}
.card-footer {
  background-color: #f8f9fa;
  padding: 10px 15px;
  border-top: 1px solid #ddd;
}
</style>
